package com.evaluationSystem.enums;

import lombok.Getter;

/**
 * @ClassName ContentTypeEnum
 * @Description TODO
 * @Author yinzhenxing
 * @Date 2022/11/15 15:31
 **/
public enum ContentTypeEnum {

    HTML("html", "text/html"),
    CSS("css", "text/css"),
    PNG("png", "image/png"),
    JPG("jpg", "image/jpg"),
    JS("js", "application/x-javascript"),
    PDF("pdf", "application/pdf"),
    XLS("xls", "application/vnd.ms-excel"),
    XLSX("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel");

    @Getter private String key;
    @Getter private String value;

    ContentTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static ContentTypeEnum forEach_ContentTypeEnum(String key) {
        for (ContentTypeEnum contentTypeEnum : ContentTypeEnum.values()) {
            if (key.equals(contentTypeEnum.getKey())) {
                return contentTypeEnum;
            }
        }
        return null;
    }

}
